class MyPlugin {
    constructor({ template = 'haode' }) {
        this.template = template
    }
    apply(complier) {
        complier.hooks.emit.tap('my_plugiin', (compilation) => {
            const _assets = compilation.assets
            _assets['index.html']._value = _assets['index.html']._value.replace('测试代码', '好的')
            // console.log(_assets['index.html']._value);
            // console.log(_assets['index.html']._value);
            _assets['c53cd981363901e73b36.js']._children[0]._value = _assets['c53cd981363901e73b36.js']._children[0]._value.replace('发哈市劳动法', '测试使用');
            console.log(_assets['c53cd981363901e73b36.js']._children[0]._value);
        })
    }
}

module.exports = MyPlugin